package com.powerbank.usercenter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.powerbank.usercenter.entity.UserProfile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 用户档案Mapper
 */
@Mapper
public interface UserProfileMapper extends BaseMapper<UserProfile> {

    /**
     * 根据用户ID查询用户档案
     */
    UserProfile selectByUserId(@Param("userId") Long userId);

    /**
     * 更新用户统计信息
     */
    int updateUserStats(@Param("userId") Long userId, 
                       @Param("totalOrders") Integer totalOrders, 
                       @Param("totalAmount") String totalAmount);

    /**
     * 更新用户等级
     */
    int updateUserLevel(@Param("userId") Long userId, @Param("userLevel") Integer userLevel);

    /**
     * 更新信用分数
     */
    int updateCreditScore(@Param("userId") Long userId, @Param("creditScore") String creditScore);
}